#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#include <assert.h>
int my_strncmp(const char* s1, const char* s2, size_t num)
{
	assert(s1 && s2);
	while (*s1 == *s2 && num--)
	{
		if (*s1 == '\0' || num == 0)
			return 0;
		s1++;
		s2++;
	}
	if (*s1 > *s2)
		return 1;
	else
		return -1;
}

int main()
{
	int ret = my_strncmp("abcdef", "abcd", 3);
	printf("%d", ret);
	return 0;
}

